import { Route, Routes } from "react-router-dom"
import LoginPage from "./components/Auth/LoginPage";
import AdminPage from "./components/AdminPage/AdminPage";
import StudentMaterialPage from "./components/StudentMaterials/StudentMaterialsPage";
import PrivateRoute from "./Utilits/Router/privateRoutes";
import Layout from "./components/Layout";
import ProfileContent from "./components/AdminPage/ProfilePage/ProfilePage";
import GroupsContent from "./components/AdminPage/GroupsPage/GroupsPage";
import MaterialsContent from "./components/AdminPage/MaterialsPage/MaterialsPage";
import PasswordRecoveryForm from "./components/Auth/PasswordRecoveryForm/PasswordRecoveryForm";

function App() {
  return (
        <Routes>
            <Route path="/" element={<Layout />}>
                <Route index element={<LoginPage />} />
                <Route index path="/login" element={<LoginPage />} />
                <Route index path="/recovery-form" element={<PasswordRecoveryForm />} />

                <Route path="/admin" element={<PrivateRoute />}>

                    <Route index element={<AdminPage />} />

                    <Route path="profile" element={<ProfileContent />} />
                    <Route path="groups" element={<GroupsContent />} />
                    <Route path="materials" element={<MaterialsContent />} />

                </Route>

                <Route path="/student-materials" element={<PrivateRoute />}>
                    <Route index element={<StudentMaterialPage />} />
                </Route>

            </Route>

        </Routes>
  );
}

export default App;
